<div class="mt20 clearfix ng-scope ml25">
    <button href="javascript:;" class="btn"
            ui-dialog="新增产品"
            ui-dialog-data="{}"
            ui-dialog-show="onProductEditShow(null,$dialog,$dialogScope)"
            ui-dialog-ok="addContractProduct($data,$dialog,$dialogScope)"
            ui-dialog-cache="false"
            ui-dialog-url="/contract/editinc/base-inc-edit-project.html"
            ng-if="contractBaseInfo.contract_status == 0 && contractBaseInfo.is_cancelled == 0"
            >新增产品
    </button>
</div>
<div id="grid" class="table-wrap mt10 ml25" style="min-height: 200px;">

    <table width="100%">
        <thead>
        <tr>
            <th width="40">序号</th>
            <th>产品名称</th>
            <th>产品类型</th>
            <th width="100" class="align-r">授权标准</th>
            <th width="100" class="align-m">购买数量</th>
            <th width="100" class="align-r">标准总额</th>
            <th width="110" class="align-r">产品租金分摊金额</th>
            <th width="100" class="align-r">预测结算金额</th>
            <th width="100" class="align-r">产品应结算金额</th>
            <th width="80" class="align-m">操作</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="project in projects" ng-if="project.__type != 'delete'">
            <td height="40"><p ng-bind="$index + 1"></p></td>
            <td class="lh14">
                <p ng-bind="project.application_name"></p>
            </td>
            <td class="lh14">
                <p >{{project.contract_type == 1 ? '新增' : (project.contract_type == 2 ? '续签' : '')}}</p>
            </td>
            <td class="align-r">
                <p ng-bind="project.unit"></p>
            </td>
            <td class="align-m">
                {{project.authorization_numeric}}
            </td>
            <td class="align-r">
                <p ng-bind="project.amount | number:2"></p>
            </td>
            <td class="align-r">
                <p ng-bind="project.share_amount | number:2"></p>
            </td>
            <td class="align-r">
                <p ng-bind="project.share_balance_amount | number:2"></p>
            </td>
            <td class="align-r">
                <p ng-bind="project.balance_should_amount | number:2"></p>
            </td>
            <td class="align-m">
                <a href="javascript:;"
                   ui-dialog="修改产品"
                   ui-dialog-data="project"
                   ui-dialog-show="onProductEditShow($data,$dialog,$dialogScope,project)"
                   ui-dialog-ok="saveContractProduct($data,$dialog,$dialogScope)"
                   ui-dialog-cache="false"
                   ui-dialog-url="/contract/editinc/base-inc-edit-project.html"
                   ng-if="contractBaseInfo.contract_status == 0"
                        >修改</a>
                <a href="javascript:void(0)" ng-click="delProject(project)" title="删除产品"
                   ng-if="contractBaseInfo.contract_status == 0"
                        >删除</a>
            </td>
        </tr>
        </tbody>
    </table>
    <div class="no-data" style="display:none"><span>暂无数据</span></div>

</div>
<div class="ml25 mt10">
    <span class="pl10">产品合计：{{projects|countProject}}</span>
    <span class="pl10">产品标准总额合计：{{projects|sumProductAmount|number}}元</span>
    <span class="pl10">短信条数合计：{{projects|countSMS|number}}条</span>
</div>